package com.lilicould.dao;

import com.lilicould.entity.*;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;

public interface ContractDao {
    //添加合同信息
    public int addContract(LeaseContract leaseContract);
    //添加合同-公寓信息
    public int addContractApartment(ContractApartment contractApartment);
    //添加合同-租户信息
    public int addContractTenant(ContractTenant contractTenant);

    // 查询所有合同信息
    public ArrayList<LeaseContract> selectAllContracts();

    // 通过合同ID查询公寓信息
    public Apartment selectApartmentByContractId(String contractId);

    // 通过合同ID查询租户信息
    public ArrayList<Tenant> selectTenantsByContractId(String contractId);

    // 通过楼栋编号和公寓编号查询合同编号
    public String selectContractIdByBuildingIdAndApartmentNo(@Param("buildingId") String buildingId,@Param("apartmentNo") String apartmentNo);

    // 通过合同编号删除合同信息
    public int deleteContract(@Param("contractId") String contractId);

    // 更新合同信息
    public int updateContract(LeaseContract leaseContract);
}
